package pers.cfeng.client;

import pers.cfeng.transport.Encoder;
import pers.cfeng.transport.Packager;
import pers.cfeng.transport.Transporter;

import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

/**
 * 客户端启动程序，直接调用Lancher输入命令打包发送给服务端socket
 *
 * mvn exec:java -Dexec.mainClass="pers.cfeng.client.Lancher"
 */

public class Lancher {
    public static void main(String[] args) throws UnknownHostException, IOException, IOException {
        Socket socket = new Socket("127.0.0.1", 9999);
        Encoder e = new Encoder();
        Transporter t = new Transporter(socket);
        Packager packager = new Packager(t, e);

        Client client = new Client(packager);
        Shell shell = new Shell(client);
        shell.run();
    }
}
